﻿using System.Collections.Generic;
using System.Linq;

namespace EFMLEditor.Internal
{
    using System.Globalization;

    using EFMLEditor.Internal.Languages;

    public class Globalisation
    {
        private Dictionary<string, Language> languages = new Dictionary<string, Language>();

        public Language Current { get; set; }

        public Globalisation()
        {
            languages.Add("English", new English());
            this.Current = this.languages.ContainsKey(CultureInfo.CurrentCulture.EnglishName) ? this.languages[CultureInfo.CurrentCulture.EnglishName] : this.languages[this.languages.First().Key];
        }

        public static Language Language
        {
            get
            {
                var r = new Globalisation();
                r.Current.Init();
                return r.Current;
            }
        }
    }



    public abstract class Language : Dictionary<string, string>
    {
        public Language()
        {
            this.Add("File", "");
            this.Add("New", "");
            this.Add("Project", "");
            this.Add("Item", "");

            this.Add("Load", "");
            this.Add("Save", "");

            this.Add("Extensions", "");

            this.Add("Help", "");
        }

        public abstract void Init();
    }

}
